fixed setlocale bug, and added c99 flag to makefile