bpo-21536: On Android, C extensions are linked to libpython (GH-12989)

diff --git a/configure b/configure
index 7f26fab..8d9c73d 100755
--- a/configure
+++ b/configure
@@ -631,6 +631,7 @@
 THREADHEADERS
 LIBPL
 PY_ENABLE_SHARED
+LIBPYTHON
 EXT_SUFFIX
 ALT_SOABI
 SOABI
@@ -15154,6 +15155,14 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDVERSION" >&5
 $as_echo "$LDVERSION" >&6; }
 
+# On Android the shared libraries must be linked with libpython.
+
+if test -z "$ANDROID_API_LEVEL"; then
+  LIBPYTHON=''
+else
+  LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
+fi
+
 
 if test x$PLATFORM_TRIPLET = x; then
   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"