Overhaul build system

Upgrade the build system to be compatible with newer autoconf/automake
versions. Remove -Werror from AM_INIT_AUTOMAKE as it could prevent building
from the git repo even for not-too-harmful warnings.

The use of subdir-objects requires automake 1.13. Require autoconf 2.69
and libtool 2.4.2 since they are both (much) older than automake 1.13 and
to make sure this doesn't mysteriously break on ancient versions.

The configure script was full of useless, autoscan-style checks, and tried
very hard to support pre-standard C systems while compiling definitely
post-standard code. Since this included a check for stdbool and stdbool
is C99, it was all replaced by a simple C99 compiler check.

Converted the automake part of the build system to use non-recursive make.
Also add the -no-undefined flag to libtool, which is a hint often needed to
build DLLs on windows or cygwin.

Update the .gitignore to ignore files added by the newer autotools
versions and the noise from the tests.
Fix warnings found by -Wextra