Added conditional include for malloc.h

To make the build compatible to Macs, I added a condition to the include of malloc.h in the header as suggested by skyhover in issue #5.