diff --git a/configure.ac b/configure.ac
index f0fa2de..789009a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -237,7 +237,12 @@ case "${host_os}" in
     ])
     AC_MSG_CHECKING([if libsynchronization is needed])
     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
-      [[#if _WIN32_WINNT >= 0x0602
+      [[#ifndef _WIN32_WINNT
+       # ifdef _WIN32
+       #  include <windows.h>
+       # endif
+       #endif
+       #if _WIN32_WINNT >= 0x0602
        # error building for Win8+ and above
        #endif
       ]],[[;]])
