There are a few different things. It could be that your dog has developed an upper respiratory illness such as kennel cough or canine influenza. Kennel cough is normally contracted when a dog has been boarded or kenneled or around a large number of dogs such as at a dog show, dog park or pet store. Here is a website with more information on kennel cough. http://www.thepetcenter.com/gen/kenc.html
Canine influenza is now becoming more prevalent and like it sounds it is a canine flu. Here is an excellent site on it.
You will want to monitor your dogs condition looking for colored discharge from the nose or eyes, a productive cough (coughs stuff up), stops eating or lethargy. These are signs of a possible bacterial infection as well and my require antibiotics. If your dog appears to be having a difficult time breathing, you will need to see your Vet as some dogs dog get really sick with canine influenza and need support to recover.
To help your dog breathe easier, Robitussin DM can be used to control the cough. Dosages can be obtained at this website. http://www.petplace.com/drug-library/dextromethorphan-robitussin-dm/page1.aspx
A heart condition such as heartworms can also cause a cough, which will need to be checked since your dog is an older dog.
One thing I always worry about when I hear a dog is gagging or dry heaving after eating and drinking is a condition called bloat. I'm not saying this is what is happening, but it is possible. Bloat (Gastric Dilatation) may or may not involve stomach torsion (twisted stomach). Common symptoms are attempts to vomit (usually unsuccessful) and may continue to try to vomit, dog just doesn't seem like themselves, a hunched up posture, anxiety and restlessness, a distended stomach that is tight like a drum, gums may be dark red in early stages and white or blue in later stages. These are the most common symptoms and the list goes on. If you ever believe your dog has bloat they should be seen immediately. Simethicone products like gas-x may help while you take him into the vet. You can read more on bloat here.
Hope this information is helpful to you.