Allow users to disable -Werror at configure time

Some users and distro packagers might not want to build with -Werror,
this allows them to disable using -Werror but enables it in the default
case so as to maintain the current behavior.

Currently this patch is carried by Gentoo to support our policy of not building packages with -Werror by default.