Fix link error

On my setup (Ubuntu 12.04, gcc 4.6.3) linking fails unless -lpthread is explicitly passed to the linker