--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,7 @@
 GLU_LIBS=
 HOST=
 case "${host}" in
-   *msvc*)
+   *msvc*|*-mingw32)
       HOST=MSW 
       GLU_LIBS="-lopengl32 -lglu32"
       ;;
@@ -75,14 +75,14 @@
 GLEW_LIBS=
 
 AS_IF([test "x$with_glew" != xno],
-      [AC_CHECK_LIB([GLEW], [glewInit],
-    [PKG_CHECK_MODULES([GLEW], [glew], [], [GLEW_LIBS="-lGLEW"])
+      [AC_CHECK_LIB([glew32], [glewInit],
+     [PKG_CHECK_MODULES([GLEW], [glew], [], [GLEW_LIBS="-lglew32"])
      AC_DEFINE([SYSTEM_GLEW])],
     [if test "x$with_glew" = xyes; then
         AC_MSG_FAILURE([--with-glew was given, but test for glew failed])
     fi])])
 
-AM_CONDITIONAL([SYSTEM_GLEW], [test "x$ac_cv_lib_GLEW_glewInit" = xyes])
+AM_CONDITIONAL([SYSTEM_GLEW], [test "x$ac_cv_lib_glew32_glewInit" = xyes])
 AC_SUBST([GLEW_LIBS])
 
 WXCONFIG=wx-config