Added more checks to the automake script