minor fix : use the correct format for unsigned long
fixed the makefile to build properly on osx
added targets to build a static library and to install libs and headers

the environment variablesLIBDIR and INCDIR, if defined,
will be used as target install directories