Add "-rt" to prevent "undefined reference to `clock_gettime'" error.

Cannot build in Ubuntu, it shows "undefined reference to `clock_gettime'" error.
So I add condition to decide whether to link rt.