Honor variables so static builds work correctly.

This reverts commit 2293455c5ce91beb77053c7c840d5252d38923c4.
See issue #471.