update buildsystem (cleanup and library build for cmake)

* updated plain makefiles
  * moved api/api.* to other source files (this allow to eliminate almost-the-same Makefile and filelist.mk)
  * integrate library build to existing targets
  * nicer messages
* update cmake build ('build library' option)