--- ./configure_orig	2022-07-19 16:51:58 +0000
+++ ./configure	2022-07-19 17:12:12 +0000
@@ -15458,7 +15458,7 @@
 
 # On Android and Cygwin the shared libraries must be linked with libpython.
 
-if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin"; then
+if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin" -o "$MACHDEP" = "aix"; then
   LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
 else
   LIBPYTHON=''
--- ./configure.ac_orig	2022-07-19 17:12:21 +0000
+++ ./configure.ac	2022-07-19 17:13:24 +0000
@@ -4832,7 +4832,7 @@
 
 # On Android and Cygwin the shared libraries must be linked with libpython.
 AC_SUBST(LIBPYTHON)
-if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin"; then
+if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin" -o "$MACHDEP" = "aix"; then
   LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
 else
   LIBPYTHON=''
--- ./Lib/distutils/command/build_ext.py_orig	2022-07-19 16:46:45 +0000
+++ ./Lib/distutils/command/build_ext.py	2022-07-19 16:49:04 +0000
@@ -740,6 +740,8 @@
                     link_libpython = True
                 elif sys.platform == 'cygwin':
                     link_libpython = True
+                elif sys.platform[:3] == 'aix':
+                    link_libpython = True
                 elif '_PYTHON_HOST_PLATFORM' in os.environ:
                     # We are cross-compiling for one of the relevant platforms
                     if get_config_var('ANDROID_API_LEVEL') != 0:
