[build] Fix Python detection in Autotools build.