ugly workaround to get link flags right in both Linux and OSX, without using logic