build: Fixing dependency detection

When detecting location of the library, `includes` and `libpath`
variables must be used instead of `cxxflags` and `linkflags` to specify
path to includes and path to the libraries.

Change-Id: I81048a9c80f3e743630a0e80231fc6290aa782ec