autotools: Fix autoconf-archive compatibility issues

autoconf-archive 2019-01-06 changed the setup of code coverage support.
Deal with both old and new. Based on Patrick Venture's similar patch in
other repositories[1].

[1] https://github.com/openbmc/phosphor-pid-control/commit/90e9dbcae6c1df3127dd3de41f9d1e1b5a438828

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ibf7b240f0b3e78ba80f587de7a0f8a1e804a7446
diff --git a/Makefile.am b/Makefile.am
index 66f6528..0b8c6ae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -69,7 +69,13 @@
 pkgconfiglibdir = ${libdir}/pkgconfig
 pkgconfiglib_DATA = phosphor-snmp.pc
 
+if AUTOCONF_CODE_COVERAGE_2019_01_06
+include $(top_srcdir)/aminclude_static.am
+clean-local: code-coverage-clean
+distclean-local: code-coverage-dist-clean
+else
 @CODE_COVERAGE_RULES@
+endif
 
 check_PROGRAMS =
 XFAIL_TESTS =
@@ -77,7 +83,3 @@
 include test/Makefile.am.include
 
 TESTS = $(check_PROGRAMS)
-
-clean-local: code-coverage-clean
-dist-clean-local: code-coverage-dist-clean
-