Improve configure.ac for Mac