Make use of builtin autoconf's python support.

This change should make Python detection more robust.

Checked on OpenSuSE and Mac.