build: Cleanup main Makefile

This changeset makes it possible to override CFLAGS and LDFLAGS from
the outside. This enables custom Makefiles to include the base
Makefile. The changeset also adds a makefile to build 32-bit static
binaries on x86.