Apparently the cause is over-striding - taking too long a stride. You're using the small muscles on the shin rather than the larger muscles in the calf. You need to change your walking technique to prevent the same problem in future. Possibly different walking shoes would help. There's no way to strengthen muscles to prevent it happening.
Hope that helps. You have my sympathy, because it's very painful, but the good news is that it should clear up pretty quickly.