Was the medicine a dewormer. I don't want to sound to rude so understand the context as this is not critism to you...but was this an inexperienced breeder? Because, I find it unusual - most reputable would not let a pup go before 6 weeks (8 is the norm), let alone 5 weeks...so suffice to say, this pup likely didn't get the proper vetting before being handed over to you.
He likely had parasites from the mother and may now have SIBO (bacterial overgrowth) do to an underdeveloped immune system and parasites feasting...the die off from these microbes are making him feel sick.
Seacure is a good suppliment for puppies - expensive, but will help.
Click on the underlined
Seacure for Pets 100g powder by Proper Nutrition
Seacure for Pets speeds the healing of wounds throughout the body, repairs digestive organs, alleviates nausea and vomiting, stops diarrhea, supports the liver during detoxification, reduces the side effects of chemotherapy and possibly helps prevent or reverse cancer, prevents toxemia in pregnancy, rescues newborns from Fading Puppy Syndrome, helps elderly dogs maintain their strength and stamina, helps all dogs recover from chronic and acute illness, stimulates hair growth, reduces urinary tract infection, reduces or eliminates allergic reactions, prevents hot spots improves mobility, reduces pain, and even enhances the effectiveness of homeopathy and herbal therapies.
That miracle food exists, and dogs love its taste. They should. It's an odoriferous powder made from fermented fish.