[build] Check the populated directory in a way that doesn't cause make to error out.