Fix compilation problems

Let me know if it works - I'll keep making changes until it does.

Also, I tried adjusting @Thumperrr's makefile to match the new directory structure - could someone test it?