configure: Support cross compiling with python3

$prefix needs to be honored because the build python path may be
different than the target prefix. This is consistent with what the
AM_PATH_PYTHON macro does internally.