diff -Naur tk8.6.5-orig/win/tcl.m4 tk8.6.5/win/tcl.m4
--- tk8.6.5-orig/win/tcl.m4	2016-03-03 09:21:52.442037200 +0300
+++ tk8.6.5/win/tcl.m4	2016-03-03 09:21:54.114037200 +0300
@@ -628,7 +628,6 @@
 
     if test "${GCC}" = "yes" ; then
 	extra_cflags="-pipe"
-	extra_ldflags="-pipe -static-libgcc"
 	AC_CACHE_CHECK(for mingw32 version of gcc,
 	    ac_cv_win32,
 	    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@@ -717,6 +716,7 @@
 	if test "${SHARED_BUILD}" = "0" ; then
 	    # static
 	    AC_MSG_RESULT([using static flags])
+	    extra_ldflags="-pipe -static-libgcc"
 	    runtime=
 	    LIBRARIES="\${STATIC_LIBRARIES}"
 	    EXESUFFIX="s\${DBGX}.exe"
