improvements

fixed s_grid struct data-alignements.
added const to read-only functions parameters.
improved makefile for optimized compilation (O2)