1) changed the creation of shared libs on darwin (mac os x):
the way to create a shared library is with -dynamiclib instead of -shared.
2) added *.dylib files to .gitignore.
3) changed the -whole-archive option on darwin to the proper one.
4) other small fixes in makefile to adjust to mac.