move math lib linking to end