I have always allowed the crits and such with a Feat purchase, or some sort of Ranger Foe type of character class trait.
The Feats are simple:
Ghost Hunter: allows crits, sneak attacks, etc. against incorporeal undead. Prerequisite Knowledge Religion 6 ranks
Deanimator: allows crits, sneak attacks, etc. against animated or corporeal undead types (skeletons, zombies, and their variants). Prerequisite Knowledge Religion 4 ranks
Vampire Hunter: allows crits, sneak attacks, etc. against free willed undead types like vampires, wights, ghouls, etc. (and their variants). Prerequisite Knowledge Religion 6 ranks.
Additional feats can be conceived for Constructs, but I never needed to create one so far.
For certain classes such as Rangers or others (homebrewed or PRC) who have a particular focus against undead types (or constructs etc), I would simply grant the appropriate feat(s) as bonus feats when necessary.