diff --git a/configure b/configure
index e7c8c97..f6b9ad1 100755
--- a/configure.in
+++ b/configure.in
@@ -116,7 +116,7 @@
         #VERSION_SOURCES="$srcdir/version.rc"
         EXE=".exe"
 	;;
-    *-*-cygwin* | *-*-mingw32*)
+    *-*-cygwin* | *-*-mingw*)
         VERSION_SOURCES="$srcdir/version.rc"
         EXE=".exe"
         if test "$build" != "$host"; then # cross-compiling
@@ -181,12 +181,13 @@
     gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
     gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
     env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
+    env_path=`echo $PATH | sed 's/:/ /g'`
     if test "$cross_compiling" = yes; then
         host_lib_path=""
     else
         host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
     fi
-    for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
+    for path in $gcc_bin_path $gcc_lib_path $env_lib_path $env_path $host_lib_path; do
         lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`]
         if test x$lib != x; then
             echo $lib
@@ -284,7 +285,7 @@
             *-*-darwin*)
                 mikmod_lib=[`find_lib libmikmod.dylib`]
                 ;;
-            *-*-cygwin* | *-*-mingw32*)
+            *-*-cygwin* | *-*-mingw*)
                 mikmod_lib=[`find_lib "libmikmod*.dll"`]
                 ;;
             *)
@@ -350,7 +351,7 @@
             *mingw32ce*)
                 use_music_native_midi=no
                 ;;
-            *-*-cygwin* | *-*-mingw32*)
+            *-*-cygwin* | *-*-mingw*)
                 use_music_native_midi=yes
                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
                 ;;
@@ -392,8 +393,11 @@
                         fluidsynth_lib=[`find_lib libfluidsynth.[0-9]*`]
                     fi
                     ;;
-                *-*-cygwin* | *-*-mingw32*)
+                *-*-cygwin* | *-*-mingw*)
                     fluidsynth_lib=[`find_lib "fluidsynth*.dll"`]
+                    if test x$fluidsynth_lib = x; then
+                        fluidsynth_lib=`find_lib "libfluidsynth*.dll"`
+                    fi
                     ;;
                 *)
                     fluidsynth_lib=[`find_lib "libfluidsynth.so.[0-9]"`]
@@ -441,8 +445,11 @@
                         ogg_lib=[`find_lib libvorbisidec.[0-9]*`]
                     fi
                     ;;
-                *-*-cygwin* | *-*-mingw32*)
+                *-*-cygwin* | *-*-mingw*)
                     ogg_lib=[`find_lib "vorbisidec*.dll"`]
+                    if test x$ogg_lib = x; then
+                        ogg_lib=`find_lib "libvorbisidec*.dll"`
+                    fi
                     ;;
                 *)
                     ogg_lib=[`find_lib "libvorbisidec.so.[0-9]"`]
@@ -471,8 +478,11 @@
                 *-*-darwin*)
                     ogg_lib=[`find_lib libvorbisfile.dylib`]
                     ;;
-                *-*-cygwin* | *-*-mingw32*)
+                *-*-cygwin* | *-*-mingw*)
                     ogg_lib=[`find_lib "libvorbisfile*.dll"`]
+                    if test x$ogg_lib = x; then
+                        ogg_lib=`find_lib "libvorbisfile*.dll"`
+                    fi
                     ;;
                 *)
                     ogg_lib=[`find_lib "libvorbisfile.so.[0-9]"`]
@@ -531,8 +541,8 @@
                 *-*-darwin*)
                     flac_lib=[`find_lib libFLAC.dylib`]
                     ;;
-                *-*-cygwin* | *-*-mingw32*)
-                    flac_lib=[`find_lib "libFLAC*.dll"`]
+                *-*-cygwin* | *-*-mingw*)
+                    flac_lib=[`find_lib "libFLAC-*.dll"`]
                     ;;
                 *)
                     flac_lib=[`find_lib "libFLAC.so.[0-9]"`]
@@ -573,7 +583,7 @@
             *-*-darwin*)
                 smpeg_lib=[`find_lib libsmpeg.dylib`]
                 ;;
-            *-*-cygwin* | *-*-mingw32*)
+            *-*-cygwin* | *-*-mingw*)
                 smpeg_lib=[`find_lib "smpeg*.dll"`]
                 ;;
             *)
@@ -653,10 +653,10 @@
 
 VERSION_OBJECTS=`echo $VERSION_SOURCES`
 VERSION_DEPENDS=`echo $VERSION_SOURCES`
-VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
+VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.lo,g'`
 VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.rc,\\
-$(objects)/\2.o: \1/\2.rc\\
-	\$(WINDRES) \$< \$@,g'`
+$(objects)/\2.lo: \1/\2.rc\\
+	\$(LIBTOOL) --mode=compile \$(WINDRES) \$< -o \$@,g'`
 VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\\$,\\\\$,g'`
 
 PLAYWAVE_SOURCES="$srcdir/playwave.c"
