Fix tests on Mac OS X

Options need to be *before* other arguments in standard getopt().
Use the exact type in realloc(N * sizeof(TYPE*))

This is clearer and silences warnings from clang's static analyzer.
Makefile dependency fixes

Suffix rules do not have prerequisites (these were being silently
ignored by GNU Make).  main.c does not depend on $(HTSDIR)/version.h.