fix source file vs library order in a few prereq checks (#4326)