A man who stabbed a nine-year-old girl outside her mother's embroidery shop has been jailed for a minimum of 25 years.