build: fix libomcache soname and allow cflags overrides

The -soname linker flag was pointing to an empty variable instead of the
versioned soname we were supposed to use.  Also updated the way CFLAGS,
CPPFLAGS and LDFLAGS are used to make it easier to override them on
commandline.