Merge pull request #3 from zotonic/mw-misc-fixes-20130219

Thanks Marc.
Download rebar using httpc
The LDFLAGS was darwin (OSX) specific
separate LDFLAGS for freebsd and darwin