Refactored configure.ac

This patch implements request #269.