I was facing the same problem today when playing with SHAM-LINKs
a soultion/workaround seems to be to allow Sham-link endpoints to be redistributed into OSPF on PE routers
on PE routers themself the sham-link endpoint is reachable via BGP route and no sham-link flapping is occuring.
EXPLANATION:
IOS tries to bring the sham-link up when:
1. It's configured and we check if we have a BGP route for the other end point
OR
2. When we receive the bgp route for the other endpoint and we want to redistribute it. Instead of redistributing the sham-link goes up. That's a way OSPF get the notification that the BGP route has arrived
it makes sense since after reload the sham-links is present in startup configuration but BGP convergence takes some time
source:
http://www.routerie.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=96;t=000005