My friend was in your shoes. Just staying afloat. He actually failed one class. He passed the boards fine, well below average again. However, I was at a very competitive school where the average board score was quite strong. He went into a non competitive residency. His problem was pure laziness, and maybe too much alcohol. He would never have matched into a competitive field with his grades and scores. I'm sure the comments in his deans letter were all essentially "competent, but lazy". If you want a competitive residency lock onto the department like a guided missile, go to lectures, meetings, journal club, etc, study and work longer and harder than ever before on your audition months, and suck up more than a ....... on a Friday night after payday. It can be done.