Add C and CPP flag support for pthread