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
Merge pull request #77 from mgreter/master

Aligns build system with autotools build and travis-ci
Merge remote-tracking branch 'upstream/master' into import-once