Makefile fixes for static libraries and split of GL related base