Set outdir correctly when compiling to non ebin directories

Otherwise the beam file will be written to the wrong directory the second
time you save/compile it.
Merge pull request #44 from dgud/dgud/fix-outdir

Set outdir correctly when compiling to non ebin directories