Chin up! You obviously didn't get what you wanted, but there is no sense in crying over it now. Don't let it get you down. Your goal now is simple: parlay your prelim spot into a categorical spot somewhere that you will be happy. You may have to re-do the intern year, not uncommon, but honestly... you've delayed gratification this long, don't let one more year stand in your way.
Things to do:
Sit down with your advisors at your medical school and discuss what you think might have gone wrong. (Did you rank too few programs? Did you overshoot? Do you need interviewing work? etc.) Don't worry about the things you can't fix (e.g. grades, board scores, etc.)
Get prepared for your new hospital. Think of this year as a very long audition rotation. That means, you need to work harder, act more interested, be better prepared than the next person. You really want your program director to be willing to stick his neck out for you and you will need a letter from him/her as one of your letters probably.
Plan to reapply for the match. Even if you aren't particularly interested in repeating your intern year (who is?!) the exposure you can get to those programs and their program directors is invaluable. Often times, if the PD knows that they will have a hole in the program (not uncommon by Jan for someone to drop out somewhere) they will remember you as someone who can fill the spot.
Finally, as RIO said: Make sure to stay in close touch with your own pd. Virtually all the best positions are passed on through word of mouth. A very few make it through open postings that can be found in journals or the web (the APDS website is probably the best for this,
www.apds.org click on the left side for open positions as well as available residents to post your own ad)
Above all, don't give up hope. If surgery is your calling, don't let this setback keep you from it. Good luck!