    *-pc-windows* | *-pc-winnt* | *-cygwin* | *-mingw*)
      if test "$bx_plugins" = 1; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opendir in -lmingwex" >&5
+diff --git a/configure.in b/configure.in
+index e8a576b..578103d 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1867,7 +1867,7 @@ SLASH="/"
+ CXXFP=""
+ CFP=""
+ OFP="-o "
+-MAKELIB="ar rv \$@"
++MAKELIB="\$(AR) rv \$@"
+ RMCOMMAND="rm -f "
+ # first define link variables without libtool
+ LINK="\$(CXX) -o \$@ \$(CXXFLAGS) \$(LDFLAGS)"
 diff --git a/cpu/Makefile.in b/cpu/Makefile.in
 index a6541fd..4d657e9 100644
 --- a/cpu/Makefile.in

 	| ns16k | ns32k \
 	| or32 \
diff --git a/configure b/configure
index 4f28619..d22edad 100755
--- a/configure
+++ b/configure
@@ -3748,11 +3748,11 @@ $as_echo "no" >&6; }

diff --git a/Makefile.in b/Makefile.in
index 5349180..4ea8a5d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -83,6 +83,7 @@ SHELL = /bin/sh
 
 @SET_MAKE@
 
+AR = @AR@
 CC = @CC@
 CXX = @CXX@
 CFLAGS = @CFLAGS@ @GUI_CFLAGS@ $(MCH_CFLAGS) $(FLA_FLAGS) @DEFINE_PLUGIN_PATH@ -DBX_SHARE_PATH='"$(sharedir)"'
@@ -225,20 +226,20 @@ bochs_plugins:
 	@CD_UP_ONE@
 
 bximage@EXE@: misc/bximage.o
