Update autogen.sh for portability.

Replace explicit calls to various autotools with the metatool supplied for that
purpose (lp: #994171).