Fix build scripts for Arduino Mega 2560

The build scripts were improved to assume less about the build environment.
Command line flags for specifying the location of MPIDE and the Wiring library
(implementing digitalWrite, digitalRead, ...) were added.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>