Malaysia to put security council on legal footing: PM