Avoid reconfigure on each static build
fix build under linux
fix build on osx
fix build order.
Merge changes from https://github.com/benoitc/erlang-czmq feature/static_build