One possible and often attested origin of the word drug is middle low german droge waere "dried wares", which targets dried herbs and spices. Making such dried herbs is generally legal (except when the plant it is made from is illegal in the first place, see making controlled substances below).
The more modern use is short for "pharmaceutical drug" as in any kind of medicine. To be allowed to create medicine, you need a (state) license as a pharmacist and FDA approval of your drug to be allowed to make your drug, so no, you can't make it at home, you need an FDA approved process in a laboratory or plant.
You might also need a license from the current patentholder.
Some chemicals that can be pharmaceutical drugs also used in other ways, or on their own. As Chemicals other laws might apply: Nitroglycerin is a heart stimulant and an explosive as well as an intermediate for producing other materials. It's production and sale is regulated as an explosive.
Some raw materials are regulated too due to how they can be used or what danger they pose.
The colloquial term drug is shorthand for illegal/controlled substance. Because the possession and manufacturing of such substances itself usually are illegal out of very very strict bounds, manufacturing it even without intent to use or sell it at home is, of course, illegal as you breach the extremely tight bounds of the law here. The intent is not part of a possession° crime but as an aggravating factor. You'll be convicted for illegal manufacturing & possession of a controlled substance under the Controlled Substance Act - or the applicable state law, maybe even both as Double Jeopardy does not apply to the same offense breaking the laws of two sovereigns (state and federal). Also, intent is not defined by what you want to do in drug law, it is defined by the amount you have - if you have more than a personal dose, it's automatically intent to distribute. Read further here
There are at times exceptions that allow for pharmaceutical studies to create and/or use controlled substances in a very limited manner.