diff -urN a/configure.ac b/configure.ac
--- a/configure.ac	2014-08-12 22:40:36.914721200 +0100
+++ b/configure.ac	2014-08-12 22:40:37.473753200 +0100
@@ -1117,6 +1117,9 @@
         darwin*)
 AC_ARG_ENABLE(macos-framework, [  --disable-macos-framework       disable building and installing replacement SASL2 Framework for MacOS X-provided SASL Framework [[no]]],building_for_macosx=no,building_for_macosx=yes)
         ;;
+        mingw*)
+AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, [Define to 1, avoids handle_t redefinition.])
+        ;;
 esac
 AM_CONDITIONAL(MACOSX, test "$building_for_macosx" = yes)
 AM_CONDITIONAL(WINDOWS, test "$host_os" = "mingw32")
