Make generate runnable from anywhere and take old versions of gnuplot into consideration

Not so much to comment :)