Drink less?
Hangovers are a combination of lack of b vitamins, loss of salt (the reason bar food tastes really good when drunk), and dehydration. Your liver needs a lot of water to process and filter out all the toxins (alcohol among them) and in this process you pee a lot which removes salt and b vitamins from your body.
Homebrew, as it happens, is loaded with live yeast which is b vitamin rich (brewer's yeast). This won't eliminate hangovers, but I will tell you that I've yet to suffer a day ruining hangover by over imbibing homebrew. Commercial beer, on the other hand, filters out this yeast to make their beer sparkling clear. Homebrew can appear sparkling clear but at the bottom is the yeast sediment, by swirling this up and drinking it (doesn't taste bad for the most part) you get a large dose. Yeast is huge on b vitamins, and will mostly prevent headaches, and regulate you.
You can further help yourself by ensuring you are well hydrated before you start drinking, and rehydrate for an hour or so after your last drink before you goto sleep. Just have a few glasses of water. Also remember that you also filter alcohol out of your system through your pores. Your skin needs to breathe so take a shower shortly after you wake up to open the pores.
Last resort, keep some ib profen next to the bedside when you wake up and plan on sleeping for awhile. The body doesn't like getting drunk just your brain... sleep gives the body much needed restorative rest and time for your liver to filter out all the junk you put in it.
P.S. Sorry for the rambling... I only get headaches when I overindulge in commercial beer, I've never felt crappy from homebrew, maybe a little tired and run down, but never crappy.