Add support for compiling on Mac OSX

On Mac OSX -lcrypt is not needed and will cause a linker error. Additionally, crypt() is defined in unistd.h, not crypt.h.