New approach for synthesizing Mg-based alloys