Variant sent upstream (configure.ac hunk irrelevant now): https://github.com/phaag/nfdump/pull/336
https://bugs.gentoo.org/832420
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,4 @@
+ACLOCAL_AMFLAGS = -I m4
 
 SUBDIRS = . bin man doc
 
--- a/configure.ac
+++ b/configure.ac
@@ -7,6 +7,7 @@ AC_INIT(nfdump, 1.6.23, peter@people.ops-trust.net)
 
 AC_CONFIG_HEADER([config.h])
 AM_INIT_AUTOMAKE([subdir-objects])
+AC_CONFIG_MACRO_DIR([m4])
 
 # Checks for programs.
 AX_CHECK_C11
