Trim the tops off 2 heads of garlic; sprinkle with olive oil and salt. Wrap in foil and roast at 350 degrees F, about 40 minutes. Squeeze the garlic out of its skin and mix with 1 grated tomato and 2 tablespoons grated parmesan; season with salt, pepper and fresh thyme. Grill 4 ears of corn, turning, about 12 minutes. Cover with the tomato mixture.