Hello Sayi,
Thank you for posting your question on the Mellanox Community.
As per your question, unfortunately when trying to rebuild the MLNX_OFED/MLNX_EN driver for another kernel other than the default kernel, you need the source of that kernel available to build against.
Thank you,
~Mellanox Technical Support