Aligns build system with autotools build and travis-ci

Implements BUILD variable to link shared or static
Expects libraries in lib directory as with autotools build