add lpthread just in case