Compute thread headers through shell expansion in configure.
Fixes #485679.
diff --git a/configure.in b/configure.in
index 349042b..adfb2fd 100644
--- a/configure.in
+++ b/configure.in
@@ -2018,6 +2018,13 @@
 #    AC_MSG_RESULT(already exists)
 #fi
 
+AC_SUBST(THREADHEADERS)
+
+for h in `(cd $srcdir;echo Python/thread_*.h)`
+do
+  THREADHEADERS="$THREADHEADERS \$(srcdir)/$h"
+done
+
 AC_SUBST(SRCDIRS)
 SRCDIRS="Parser Grammar Objects Python Modules"
 AC_MSG_CHECKING(for build directories)