A constructive version of the Boyle-Handelman theorem on the spectra of nonnegative matrices