enable building on macos

* enabled MAC OS build by adding an if state to execute glibtoolize instead of libtoolize for building

* included <stblib.h> header that was necessary to made "free" function beeing imported under MacOS