makefiles: fixup the file extraction

Change-Id: I0b8f9956d324c62ef951810f3b3b6cd2b953be62