Fix makefile

Fixing makefile. Linking with lib pthread