Revert "Change order of compiler parameters. (-lm last)"

This reverts commit 4d3f5b5005b58164215fd14d7edee9a1c70df367.