--- a/configure.ac	2020-07-04 20:59:04.718066026 +0700
+++ b/configure.ac	2020-07-04 20:59:54.542554633 +0700
@@ -370,7 +370,7 @@
 	[have_python="no"])
 
 if test x$have_python = xyes; then
-	if test -x $PYTHON-config; then
+	if $PYTHON-config --cflags; then
 		PYTHON_CFLAGS=`$PYTHON-config --cflags`
 		PYTHON_LIBS=`$PYTHON-config --libs`
 		AC_SUBST(PYTHON_CFLAGS)
