understanding building and using static and shared libraries and makefile