Move link flags to end of command to allow linking on Linux