Optimizations and bugfixes for dudetray

Added optimization flag to makefile
Added debug target to makefile
Corrected problem with malloc size incorrect for some architectures
Removed debug warning about return value for fread
Handled the max messages and saving of notifications in memory better