diff --git a/fltk-config.in b/fltk-config.in
index dee2cf0..830246c 100644
--- a/fltk-config.in
+++ b/fltk-config.in
@@ -271,8 +271,19 @@ else
 fi
 
 # Calculate needed libraries
-LDSTATIC="$libdir/libfltk.a $LDLIBS"
-LDLIBS="-lfltk$SHAREDSUFFIX $LDLIBS"
+# Remove "-luuid" from shared linker flags. Only needed for mingw.
+LDSTATICLIBS="$LDLIBS"
+LDSHAREDLIBS=""
+for L in $LDLIBS
+do
+  if [ $L != "-luuid" ]
+  then
+    LDSHAREDLIBS="${LDSHAREDLIBS} $L"
+  fi
+done
+
+LDSTATIC="$libdir/libfltk.a $LDSTATICLIBS"
+LDLIBS="-lfltk$SHAREDSUFFIX $LDSHAREDLIBS"
 
 if test x$use_forms = xyes; then
     LDLIBS="-lfltk_forms$SHAREDSUFFIX $LDLIBS"
