Rinse and drain beans. Discard damaged beans and any foreign material.
Cover beans with 6 cups water and boil for two minutes. Cover pot; soak for one to four hours. Discard soaking water.
Cut meat from ham bone into 3 or 4 large pieces. Saute' onion in butter or margarine until soft and golden in a 4-quart pot. Add beans, 4 cups water, bouillon cube, ham shank bone and ham pieces, bay leaves, thyme, oregano, salt, and red pepper flakes; bring to boil
Reduce heat, cover pot, and simmer for 1 to 1-1/2 hours, or until beans are tender.
Discard bay leaves. Remove ham shank. Cut meat from bone and discard bone. Dice meat into bite-sized pieces and return to the pot.
Remove 1 cup beans from pot and mash with potato masher or fork. Return mashed beans to pot and stir to thicken.
Add diced meat, chopped green pepper and rum (if desired);cover and simmer 15 minutes.
Serve beans over rice. Top each serving with a dollop of sour cream (if desired).