--- configure.ac.orig	2021-10-07 19:27:41.000000000 -0400
+++ configure.ac	2021-10-07 19:29:04.000000000 -0400
@@ -77,6 +77,15 @@
 
 AM_PATH_PYTHON(2.3.5)
 
+AC_SUBST([PYTHON_PREFIX], [`$PYTHON -c 'import sys; print(sys.prefix);'`])
+AC_SUBST([PYTHON_EXEC_PREFIX], [`$PYTHON -c 'import sys; print(sys.exec_prefix)'`])
+
+am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
+am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
+
+AC_SUBST([pythondir], [$am_cv_python_pythondir])
+AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
+
 AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
 
 AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h])
