I think that it's great that you make your own foods! My kids never liked the store stuff, either.
Please think really hard before you accept the statement that he's "not gaining enough weight." Both my sister and I have been told that about our children, and we just happened to be moms of kids with lean bodies. My daughter is seven now and still lean. My current pediatrician (who never said she wasn't gaining enough) points out that she grows consistently, has plenty of energy, and does well in school. So, if your child is active, happy, plays and sleeps well, you might want to consider that he's just fine.
Also, if he's breastfed, the old growth charts really won't work for him. The World Health Organzation revised their charts to take into account normal breastfed babies a few years back, and not all doctors have switched. I don't know why I could only find them through a Canadian site this morning, but here's a link: http://www.dietitians.ca/Secondary-Pages/Public/Who-Growt...
Kids eat to appetite--they have no hang ups--and if they stop eating, they're full. I agree that you should feed him breastmilk or formula on demand. If he doesn't eat it, he doesn't need it!
I know how much it can worry you when the doctor says he's not gaining enough. But please check your own thoughts and feelings on it, and maybe get a second opinion!