Makefile: Improve libav selection

See #447.