Undead are immune to any effect that requires a fortitude save and doesn't affect objects, thus they are unaffected by Baleful Polymorph. Polymorph any object can affect them though, as it can target objects. I think liches flat out get immunity to polymorph effects.