Fixed building on Linux, missing materials and fixed double event call in IDE

hdr.pak was accidentally missing from the build script. This led to a segfault when accessing a NULL pointer in getMaterial().

Fixed the Makefile to include the hdr.pak and also added a sanity check for null pointer.

Also fixed the event that was fired twice when opening files in the project filetree. Changed the event from EVENT_SELECTED to EVENT_EXECUTE, now to open files you need to doubleclick.