The solution for my problem was solved in that post [1]
I had to add this for the calibration:
imu.getMotion9(&ax, &ay, &az, &gx, &gy, &gz, &mx, &my, &mz);
mx=(mx-17.0317)/100; // Gauss, IMU output = micro Tesla
my=(my-25.7831)/100; // Gauss
mz=(mz+12.5051)/100; // Gauss
ahrs.update(ax, ay, az, gx0.0175, gy0.0175, gz*0.0175, my, mx, -mz, dt);