Use withval for with_hash and with_random

It's not necessary to have every alternative to the --with-hash and the
--with-random configure option listen on separate rows. Since all we do
is assigning the withval to val all we need is a single line with all
alternatives.

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