Autoconf improvements, part 2

Only behaviour change should be building with -O1 for debug builds (currently default).