Make sure the window is never released before the renderer

Tentative fix for an OSX VM crash when the owner process dies.
Use erlang.mk with newly added NIF support!
c opts for Mac