$ autoreconf -if
aclocal-1.15: overwriting 'm4/ax_cxx_compile_stdcxx.m4' \
 with '/usr/share/aclocal/ax_cxx_compile_stdcxx.m4'
aclocal-1.15: overwriting 'm4/ax_cxx_compile_stdcxx_11.m4' \
 with '/usr/share/aclocal/ax_cxx_compile_stdcxx_11.m4'
aclocal-1.15: installing 'm4/ax_require_defined.m4' \
 from '/usr/share/aclocal/ax_require_defined.m4'
aclocal-1.15: error: too many loops
aclocal-1.15: Please contact <bug-automake@gnu.org>.
 at /usr/share/automake-1.15/Automake/Channels.pm line 662.
	Automake::Channels::msg("automake", "", "too many loops") \
   called at /usr/share/automake-1.15/Automake/ChannelDefs.pm line 212
	Automake::ChannelDefs::prog_error("too many loops") \
   called at /usr/bin/aclocal-1.15 line 1188
autoreconf-2.69: aclocal failed with exit status: 255

automake-1.15
autoconf (GNU Autoconf) 2.69

My system is Gentoo Linux. There might be patches.
Starting autoreconf again with the same arguments finishes without
errors. Shell is ZSH.

configure.ac and Makefile.am are simple. Do you need them?