Try -Wl,--no-as-needed to fix undefined symbol: clock_gettime