At least on Ubuntu 12.04, -lrt is needed to link in clock_gettime, which is used by the runtime library.