makefiles: Add support for a generic SOURCES variable.