Explicitly set GCC compiler in Makefile
Fix incorrect memory allocation for 2D arrays
Removed unused variables