diff -Naur autoconf-2.13-orig/acspecific.m4 autoconf-2.13/acspecific.m4
--- autoconf-2.13-orig/acspecific.m4	1999-01-05 16:27:52.000000000 +0300
+++ autoconf-2.13/acspecific.m4	2013-12-05 12:47:52.345000000 +0400
@@ -2137,7 +2137,7 @@
             case "$arg" in
               -lkernel32)
                 case "$canonical_host_type" in
-                  *-*-cygwin*)
+                  *-*-cygwin*|*-*-msys*)
                     arg=
                   ;;
                   *)
diff -Naur autoconf-2.13-orig/config.guess autoconf-2.13/config.guess
--- autoconf-2.13-orig/config.guess	1999-01-05 16:28:47.000000000 +0300
+++ autoconf-2.13/config.guess	2013-12-05 12:48:27.257800000 +0400
@@ -525,6 +525,9 @@
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit 0 ;;
+    i*:MSYS*:*)
+	echo ${UNAME_MACHINE}-pc-msys
+	exit 0 ;;
     i*:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit 0 ;;
diff -Naur autoconf-2.13-orig/config.sub autoconf-2.13/config.sub
--- autoconf-2.13-orig/config.sub	1999-01-05 16:28:51.000000000 +0300
+++ autoconf-2.13/config.sub	2013-12-05 12:48:41.531800000 +0400
@@ -713,7 +713,7 @@
 	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -linux-gnu* | -uxpv* | -beos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
