How to stop prefab from resetting its user defined reference variable

I have a monster prefab which has the following movement script attached to it.
target is the destination for the monster when I instantiate it.
But as soon as I make the object as a prefab by dragging it into the assets,the target variable get reset resulting in the spawned mob just standing still
Only number variables stay constant.
Are there any workaround to allow the prefab to have a reference of the gameobject?

[SerializeField] GameObject target;

UnityEngine.AI.NavMeshAgent agent;
// Start is called before the first frame update
void Start()
{
    agent = this.GetComponent();
    agent.SetDestination(target.transform.position);
}

// Update is called once per frame
void Update()
{
    bool chase = agent.SetDestination(target.transform.position);

    if (chase == true)
    {
        agent.SetDestination(target.transform.position);
    }
 }

The easiest solution I can think of is to assign the destination after instantiation.