Will doing strength exercises and working out the leg muscles like the thigh and calve on machines improve speed or endurance in running?
Yes. Training for strength & power - low reps, heavy weight, compound lifts, explosive movements - can help your speed & acceleration. If you train your muscular endurance - high reps, low weight, Crossfit or Crossfit Endurance style metcons - you'll help your endurance running. However, it's worth mentioning a few things:
- Not all exercises are the same. There is a big difference between machines and free weights and between compound exercises and isolation exercises. See my answer here. You'll see MUCH more of an effect from squats, deadlifts, cleans, snatches, lunges and step-ups than you will from leg curls, leg extensions, and calf raises.
- Depending on your current level of running & exact goals, weight training might not be a high priority. It should go without saying that the best way to improve your running is to do more running. Any cross training you do is secondary in importance and should be scheduled accordingly.
- Watch your diet. Weight training benefits from increased mass. Running, at least for any distance over ~400m, doesn't. It is certainly possible to build a ton of strength/power without gaining any extra mass, but you have to watch what you eat. Don't get me wrong - you won't become the hulk overnight or even over a year - but adding 5-10lbs by squatting & eating a lot is easy and could negatively impact your running. Just eat maintenance calories and you'll be fine.
For someone who is new at the sport, strength training not only helps prevent injuries but will increase muscle mass thereby making running easier which means your endurance and speed improves.
However, for the elite-athlete (i.e. marathoners) the endurance gains are far less from strength training but more from just honing their craft - they just run a lot. All their muscles are used to it.