Fix warnings about obsolete/deprecated features reported by modern autotools. Also updates third-party m4 macros.