fix missing include & pthread link flag

Signed-off-by: Wilfried Chauveau <ithinuel@gmail.com>