This is a very intriguing question, particularly because although it's a somewhat rare situation, it usually shows up sooner or later. Anyway, I'd probably do it one of two ways. Either:
1. I'd loop over all the enemies whenever an object on the map is erased. If the enemy's target is the object to be erased, set the pointer in the enemy to NULL.
2. Or I'd use a "death" flag to specify that an enemy or item needs to be removed from the map. Assuming that this death flag is set before enemies are updated, the enemy could check to see if the item's death flag is set. If it's set, it would change it's target to NULL. Then, after the enemies have been updated, I'd loop over the items removing and deleting anything with a death flag.
Of the two, I'd more likely use the first because it's very easy to code. But, the second is convenient because often I already have a death flag implemented, in which case it's just a matter of having each enemy check during update if it's target's death flag is set. If some complicated situation comes up where neither are suitable, I'd definitely maintain a list of all references to each object (inside of the object's class), and on object deletion, I'd make sure that all the pointers referencing the object are set to NULL.
A lesser way to deal with the problem would be to work around it entirely. Such as, rather than storing a pointer to the target item, store it's coordinates and the intention of the enemy to get a certain type of item on those coordinates. Then you'd just need to periodically make sure that the given type of item still has those coordinates. Of course, I'd vastly prefer not to use this method because it's not a real solution, but I thought I'd throw it out there anyway