diff --git a/configure b/configure
index 69bdefce1e90734d00276f26f616117a6d26a01d..8cf25ab258b98a45bb909809c292dbe83c9c3c20 100755
--- a/configure
+++ b/configure
@@ -3850,7 +3850,8 @@ check_header windows.h
 check_header X11/extensions/XvMClib.h
 
 if ! disabled w32threads && ! enabled pthreads; then
-    check_func_headers "windows.h process.h" _beginthreadex && enable w32threads
+    check_func_headers "windows.h process.h" _beginthreadex &&
+        enable w32threads || disable w32threads
 fi
 
 # check for some common methods of building with pthread support