split reaction functions into reaction.c and fixed Makefile