The finite-gap method and the periodic NLS Cauchy problem of anomalous waves for a finite number of unstable modes