A powergamer is someone who makes an optimum character (a "build") for a specific purpose within the context of the D&D rules. This purpose can be combat, or diplomacy, or being able to cast 9th level Arcane and Divine spells, or anything else the player wants. The key points here are the words optimum and within the context of the D&D rules.
A munchkin uses loopholes and interpretations of vague rules to justify incredible builds that fall far beyond the context and intent of the rules. A munchkin is essentially a powergamer on steroids: a powergamer merely does his intended role well; a munchkin will try to break the game via their "cool" character. I've noticed that many posters wrongly equate a munchkin with a powergamer when complaining. They're similar beasts, but the difference is a powergamer doesn't ruin the fun for everyone else.
A rules laywer is someone who theoretically has memorized the rulebooks and will cite various rules (typically obscure ones) in order to gain an advantage and "one-up" the DM. See Brian Van Hoose in Knights of the Dinner Table for a perfect example.
And, for the record, it's perfectly possible to be a powergamer and a good roleplayer. They are not mutually exclusive. Not all powergamers are arrogant jerks who want to hog the spotlight and boss everyone else around via threats because their character is more powerful than the rest of the group combined.