When compiling your program you must link the pthread library as well as the wiringPi
     gcc *.c -o * -lwiringPi -lpthread

