build: add --enable-werror

This allows enabling -Werror in a consistent way.  Note that this is
different from just specifiying it in CFLAGS, since that would either
break configure tests (if done on ./configure), or would override
configure's CFLAGS (if done on make).

Using --enable-werror instead provides a new WERROR variable that is
additionally used during make with a consistent set of warning flags.

The tests/ directory is exempt.  (Rationale being, better to have more
tests than pedantically complain about them.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/ospfd/Makefile.am b/ospfd/Makefile.am
index 4160bfc..40f2cfe 100644
--- a/ospfd/Makefile.am
+++ b/ospfd/Makefile.am
@@ -1,6 +1,7 @@
 ## Process this file with automake to produce Makefile.in.
 
 AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
+AM_CFLAGS = $(WERROR)
 DEFS = @DEFS@ $(LOCAL_OPTS) -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=@INSTALL@ -m 600