remove redundant AC_PROG_LIBTOOL
added more error checking code
more error checking