Add butter, onion, celery, garlic, thyme and bay leaf to the pot. Reduce heat to medium and cook, stirring occasionally, until the vegetables are soft, about 3 minutes. Sprinkle flour over the vegetables and cook, stirring, for 1 minute. Stir in juices from the cans, clam juice and the reserved corncobs. Cook, stirring occasionally, until thickened, 1 to 2 minutes. Add potatoes and bring to a boil. Reduce heat to maintain a simmer; cover and cook until the potatoes are tender, 12 to 15 minutes. Discard the corncobs, thyme sprigs and bay leaf.