If an order of sale is made, and before a distribution of the proceeds thereof, the plaintiffs shall produce to the court a certificate showing the liens remaining unsatisfied, if any, by judgment upon the property, or any portion thereof, and unless he does so the court shall order a referee to ascertain them.