Updating makefile.am to be more portable.
Adding checks recommended by autoscan.