A number of autoconf cleanups

I went ahead and updated sodor's autoconf stuff to work in a more standard manner while still retaining compatibility with the different ways people seem to do things around here.