Fork gnome-autogen.sh and add automake-1.13 compatibility.

This addresses #1577.