Updated Makefile

Updated makefile to work better and crate a static library.