Replace autoconf variables with make variables

This has the nice advantage that you can override those
variables at make time instead of configure time.
Merge pull request #1609 from rubenk/replace-autoconf-variables-with-make-variables

Replace autoconf variables with make variables