Fix linking against lmath.so on systems which don't automatically do so