fix compatibility issues with OS X

This fix ensures we're able to find the correct erlang environment no matter if linux or OS X, no matter if installed from esl distribution or homebrew.