CNBC's Jim Cramer recommended investors buy companies that can put up strong revenue and earnings regardless of the economic backdrop.