Moved the extern definition from the main file & fixed some warnings

The extern was correctly in the header file, but the definition of it
was provided in the _main file rather than the actual definition file.
This meant that the unit test linked not to the _main.c file would not
have a definition of the extern.
Changed the test file to send correct arguments to the function (char rather than int)
Fixed a few errors in the Makefile

Especially, the all: target had an inexistance target