Minor build system fixes.
diff --git a/.gitignore b/.gitignore
index 6209bf6..f08cb72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,7 @@
 googletest/m4/ltsugar.m4
 googletest/m4/ltversion.m4
 googletest/m4/lt~obsolete.m4
+googlemock/m4
 
 # Ignore generated directories.
 googlemock/fused-src/
diff --git a/Makefile.am b/Makefile.am
index 433eefe..05c20c6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,4 @@
 ## Process this file with automake to produce Makefile.in
-ACLOCAL_AMFLAGS = -I m4
-
 AUTOMAKE_OPTIONS = foreign
 
 # Build . before src so that our all-local and clean-local hooks kicks in at
diff --git a/googlemock/Makefile.am b/googlemock/Makefile.am
index 8e0128f..c77ef2b 100644
--- a/googlemock/Makefile.am
+++ b/googlemock/Makefile.am
@@ -1,5 +1,7 @@
 # Automake file
 
+ACLOCAL_AMFLAGS = -I m4
+
 # Nonstandard package files for distribution.
 EXTRA_DIST = LICENSE
 
diff --git a/googlemock/configure.ac b/googlemock/configure.ac
index 9456c3d..aaa4ad4 100644
--- a/googlemock/configure.ac
+++ b/googlemock/configure.ac
@@ -8,6 +8,7 @@
 # Provide various options to initialize the Autoconf and configure processes.
 AC_PREREQ([2.59])
 AC_CONFIG_SRCDIR([./LICENSE])
+AC_CONFIG_MACRO_DIRS([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([build-aux/config.h])
 AC_CONFIG_FILES([Makefile])
diff --git a/googletest/configure.ac b/googletest/configure.ac
index 254c8c4..6cb19f4 100644
--- a/googletest/configure.ac
+++ b/googletest/configure.ac
@@ -12,7 +12,7 @@
 # Provide various options to initialize the Autoconf and configure processes.
 AC_PREREQ([2.59])
 AC_CONFIG_SRCDIR([./LICENSE])
-AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_MACRO_DIRS([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([build-aux/config.h])
 AC_CONFIG_FILES([Makefile])