Attempt to fix cmockery2 build

The current code assumes cmockery2 is installed in default paths.
Use PKG_MODULES_CHECK to find it using pkg-config if it is not. If
not found by pkg-config, try AC_CHECK_LIB.

There are also some build flag adjustement so that local overrides
do not loose the required -I flags.

This includes and enhance http://review.gluster.org/8340/

BUG: 764655
Change-Id: Ide9f77d1e70afe3c1c5c57ae2b93127af6a425f9
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8365
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Gluster Build System <jenkins@build.gluster.com>