Improved build process

Improved makefile and added rebar