Redesigned configure/Makefile setup

Adds yasm version check and handles Free/OpenBSD/win32 correctly.

Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>