makefile and math_helper

  - check what system we are compiling on
  - outsourcing math stuff