RMATH depends on librandom, so make sure that is built first. fix #1956