Fixes compilation

This patch fixes the compilation process on some Linux distributions
(such as Ubuntu) where -pthread and -lrt is required in order to link
libcheck.