configure: Fix chkhdr and chklib function
configure: Fix chkhdr and chklib function

Summary:
The chklib and chkhdr function that check for the existence of
headers and libs has been failing for some time. I changed it
so that only the relevant flags get used to the functions and
that chkhdr does not complain if the header cause warnings by
invoking cpp instead of g++.

Test Plan: Review

Reviewers: tobias

Reviewed By: tobias

Maniphest Tasks: T1278

Differential Revision: https://dev.openmha.org/D453

HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA