1) only about 20 percent of IM residents are going into general IM (most go into cards, GI, pulmonary etc.) see: http://www.medicalnewstoday.com/articles/39779.php
2) The 22,284 figure you cited includes multitudes of transitional and prelim medicine residents going into fields like radiology, ophthalmology, dermatology, radiation oncology, anesthesiology, etc.
The article I cited just above lists 2668 categorical medicine residents per year x 20% going into general IM =
534 general internists graduating per year!
This is less than the 657 general internists jobs posted on the medhunters website.
Also many general internists take jobs as hospitalists and there are an additional 309 hospitalist jobs on the medhunters website.
So overall we have 534 general internists graduating and we have available 657+309= 966 jobs posted on a single website. The situation makes the pathology job market look even more dismal by comparison.