Fix math library detection

Change order of compiler arguments.
Regenerate charmonizer.c