net-snmp-config --cflags returns the flags used to compile Net-SNMP,
not just the flags which downstreams should use. use pkg-config instead.
(needed for net-snmp 5.9.5.2 which uses Werror=declaration-after-statement
because check_snmp.c is not at all clean for this. should be filtered out
by net-snmp-config in subsequent versions).

Index: plugins/Makefile.am
--- plugins/Makefile.am.orig
+++ plugins/Makefile.am
@@ -166,7 +166,7 @@ check_real_LDADD = $(NETLIBS)
 check_snmp_SOURCES = check_snmp.c check_snmp.d/check_snmp_helpers.c
 check_snmp_LDADD = $(BASEOBJS)
 check_snmp_LDFLAGS = $(AM_LDFLAGS) -lm `net-snmp-config --libs`
-check_snmp_CFLAGS = $(AM_CFLAGS) `net-snmp-config --cflags`
+check_snmp_CFLAGS = $(AM_CFLAGS) `pkg-config --cflags netsnmp`
 check_smtp_LDADD = $(SSLOBJS)
 check_ssh_LDADD = $(NETLIBS)
 check_swap_SOURCES = check_swap.c check_swap.d/swap.c
