Make it possible to set the maximum running time

An alarm is set which will terminate the program after five seconds.
This alarm should be optional and it should be possible to specify how
long it should be at build time.

Add a configure option that allows setting the alarm time, and use it
only if it is set.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>